package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** Task数据管理 */
public class TaskDBModel extends AbstractDBModel<TaskDBModel, TaskEntity>
{
    private static TaskDBModel instance;

    public static TaskDBModel getInstance() {
        if (instance == null) {
            instance = new TaskDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "Task.data";
    }

    /** 创建实体 */
    @Override
    protected TaskEntity MakeEntity(GameDataTableParser parse)
    {
        TaskEntity entity = new TaskEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.Name = parse.GetFieldValueToUTF8String("Name");
        entity.Status = parse.GetFieldValueToInt("Status");
        entity.Content = parse.GetFieldValueToUTF8String("Content");
        return entity;
    }
}
